#include "PhysicCollisionResolution.h"

PhysicCollisionResolution::PhysicCollisionResolution(){};
PhysicCollisionResolution::~PhysicCollisionResolution(){};

void PhysicCollisionResolution::Update(LinkedList<PhysicRigidBody *> *a_RigidBodyList, float a_timePassed){
	Integrate(a_RigidBodyList, a_timePassed);
};

void PhysicCollisionResolution::Integrate(LinkedList<PhysicRigidBody *> *a_RigidBodyList, float a_timePassed){
	int t_size = a_RigidBodyList->Get_Size();
	for(int i = 0; i < t_size; i++){
		PhysicRigidBody *t_PhysicRigidBody = a_RigidBodyList->Get_Data(i);
		t_PhysicRigidBody->m_PhysicObject->m_position.add(
			t_PhysicRigidBody->m_PhysicObject->m_velocity.product(a_timePassed));
	}
};